<include file="Public/header" />
<title>我的桌面</title>
</head>
<body>
<div class="pd-20">
	<form name="form" id="form" method="post">
		<table class="table table-border table-bordered table-bg">

			<tbody>
				<tr class="text-c">
						<input type="hidden" value="<{:I('id')}>" placeholder="计划单id" id="id" name="id" >
						<td width="15%" class="text-r" style="background-color:#f5f5f5">产品名称：</td>
						<td class="text-l">
							<input type="text" class="input-text" value="" placeholder="产品名称" id="pro_name" name="pro_name" >
						</td>
						<td width="15%" class="text-r" style="background-color:#f5f5f5">产品规格：</td>
						<td class="text-l">
							<input type="text" class="input-text" value="" placeholder="产品规格" id="pro_spec" name="pro_spec" >
						</td>						
				</tr>
				<tr class="text-c">
						<td width="15%" class="text-r" style="background-color:#f5f5f5">料号：</td>
						<td class="text-l">
							<input type="text" class="input-text" value="" placeholder="料号" id="source_no" name="source_no" >
						</td>
						<td width="15%" class="text-r" style="background-color:#f5f5f5">产品编码：</td>
						<td class="text-l">
							<input type="text" class="input-text" value="" placeholder="产品编码" id="pro_no" name="pro_no" >
						</td>						
				</tr>
				<tr class="text-c">
						<td width="15%" class="text-r" style="background-color:#f5f5f5">计划数量：</td>
						<td class="text-l">
							<input type="text" class="input-text" value="" placeholder="计划数量" id="pro_num_plan" name="pro_num_plan" >
						</td>
						<td width="15%" class="text-r" style="background-color:#f5f5f5">主单位：</td>
						<td class="text-l">
							<select  class="input-text" id="unit1" name="unit1">
								<option value="0">请选择</option>
								<volist name="unit_list" id="vo">
									<option value="<{$vo.unit_no}>" <if condition="$vo['unit_no'] eq $detail['unit1']">selected</if>><{$vo.unit_name}></option>
								</volist>
							</select>
						</td>						
				</tr>
				<tr class="text-c">
						<td width="15%" class="text-r" style="background-color:#f5f5f5">生产周期要求：</td>
						<td class="text-l">
							<input type="text" class="input-text" value="" placeholder="生产周期要求" id="product_weeks" name="product_weeks" >
						</td>
						<td width="15%" class="text-r" style="background-color:#f5f5f5">申请摘要：</td>
						<td class="text-l">
							<input type="text" class="input-text" value="" placeholder="申请摘要" id="product_marks" name="product_marks" >
						</td>						
				</tr>
				<tr class="text-c">
						<td width="15%" class="text-r" style="background-color:#f5f5f5">备注：</td>
						<td class="text-l">
							<input type="text" class="input-text" value="" placeholder="备注" id="mark" name="mark" >
						</td>
						<td width="15%" class="text-r" style="background-color:#f5f5f5"></td>
						<td class="text-l">
							
						</td>						
				</tr>
			</tbody>
		</table>	
	</form>

		<div class="row cl">
			<div class="col-9 col-offset-3">
				<input class="btn btn-primary radius" type="submit" id="add" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
			</div>
		</div>

</div>
<script type="text/javascript">
    $(function(){
		/*删除*/
        $("#add").click(function(){
			var pro_name=$('#pro_name').val();
			var pro_spec=$('#pro_spec').val();
			var source_no=$('#source_no').val();
			var pro_no=$('#pro_no').val();

            //询问
			if(pro_name==""){
				layer.alert("产品名称不能为空");
				return false;
			}

			if(pro_spec==""){
				layer.alert("产品规格不能为空");
				return false;
			}
			if(source_no==""){
				layer.alert("料号不能为空");
				return false;
			}
			if(pro_no==""){
				layer.alert("产品编码不能为空");
				return false;
			}


			layer.confirm('是否确定添加此信息', {
			  btn: ['是','否'] 
			}, function(){
				$.ajax({
					type: 'POST',
					data: $("#form").serialize(),
					url: "<{:U('add_byproduct')}>",
					success:function(data){
						layer.alert(data.info,function(){
							parent.window.location.href =parent.window.location.href;
						});
					}
				})
			});
        });
    })
</script>
</body>
</html>